home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 5 / MONIKER_ / SOURCE__ / MONIKER_.C next >
C/C++ Source or Header  |  1992-06-09  |  790b  |  40 lines

  1. /* Moniker 2.0 */
  2. /* Copyright ⌐1992 by Michael J. Simms */
  3.  
  4. /* Include the program header. */
  5. #include "Moniker 2.0.h"
  6.  
  7. /* Function prototypes. */
  8. int main(void);
  9.  
  10. /* Global variable. */
  11. Boolean    gQuitDemand=FALSE;
  12.  
  13.  
  14. main(void)
  15. /* The driver - head honcho. */
  16. {
  17.     Boolean        gotEvent,canRun;
  18.     EventRecord    event;
  19.  
  20.     /* Call initialization routine. */
  21.     initialize();
  22.  
  23.     /* See if the program can run. */
  24.     canRun=canRunProgram();
  25.  
  26.     /* If the program can run then do so. */
  27.     if (canRun) {
  28.         /* Install Apple Event handlers. */
  29.         installAEHandlers();
  30.  
  31.         /* Main loop. */
  32.         do {
  33.             if (gotEvent=WaitNextEvent(highLevelEventMask,&event,kSleep,NIL))
  34.                 AEProcessAppleEvent(&event);
  35.         } while (!gQuitDemand);
  36.  
  37.         /* Remove Apple Event handlers. */
  38.         removeAEHandlers();
  39.     } else describeError(kCantRun);
  40. }